home *** CD-ROM | disk | FTP | other *** search
/ Mac Magazin/MacEasy 32 / Mac Magazin and MacEasy Magazine CD - Issue 32.iso / Grafik & Text / OzTeX3.0 / TeX-inputs / LaTeX / tools / layout.sty < prev    next >
Text File  |  1997-03-07  |  12KB  |  396 lines

  1. %%
  2. %% This is file `layout.sty',
  3. %% generated with the docstrip utility.
  4. %%
  5. %% The original source files were:
  6. %%
  7. %% layout.dtx  (with options: `package')
  8. %% 
  9. %% IMPORTANT NOTICE:
  10. %% 
  11. %% This file is a generated file from the sources of the `tools' bundle
  12. %% in the LaTeX2e distribution.
  13. %% 
  14. %% For the copyright notice see the source file(s).
  15. %% 
  16. %% You are not allowed to modify this file.
  17. %% 
  18. %% You are allowed to distribute this file if and only if
  19. %% it is distributed with the corresponding source files in
  20. %% the `tools' bundle.
  21. %% 
  22. %% For the copying and distribution conditions of the source files,
  23. %% see the file readme.txt distributed with the tools bundle.
  24. %% 
  25. \NeedsTeXFormat{LaTeX2e}
  26. \ProvidesPackage{layout}
  27.                 [1995/11/23 v1.1k Show layout parameters]
  28. \DeclareOption{dutch}{%
  29.   \def\Headertext{Kopregel}
  30.   \def\Bodytext{Broodtekst}
  31.   \def\Footertext{Voetregel}
  32.   \def\MarginNotestext{Marge\\Notities}
  33.   \def\oneinchtext{een inch}
  34.   \def\notshown{niet getoond}
  35.   }
  36. \DeclareOption{english}{%
  37.   \def\Headertext{Header}
  38.   \def\Bodytext{Body}
  39.   \def\Footertext{Footer}
  40.   \def\MarginNotestext{Margin\\Notes}
  41.   \def\oneinchtext{one inch}
  42.   \def\notshown{not shown}
  43.   }
  44. \DeclareOption{french}{%
  45.   \def\Headertext{Ent\^{e}te}
  46.   \def\Bodytext{Corps}
  47.   \def\Footertext{Pied de page}
  48.   \def\MarginNotestext{Marge\\Notes}
  49.   \def\oneinchtext{un pouce}
  50.   \def\notshown{non affich\'{e}}
  51.   }
  52. \DeclareOption{francais}{\ExecuteOptions{french}}
  53. \DeclareOption{spanish}{%
  54.   \def\Headertext{Encabezamiento}
  55.   \def\Bodytext{Cuerpo}
  56.   \def\Footertext{Pie de p\'agina}
  57.   \def\MarginNotestext{Notas\\ Marginales}
  58.   \def\oneinchtext{una pulgada}
  59.   \def\notshown{no mostradas}
  60.   }
  61. \DeclareOption{portuguese}{%
  62.   \def\Headertext{Cabe\c{c}alho}
  63.   \def\Bodytext{Corpo}
  64.   \def\Footertext{Rodap\'e}
  65.   \def\MarginNotestext{Notas\\ Marginais}
  66.   \def\oneinchtext{uma polegada}
  67.   \def\notshown{n\~ao mostradas}
  68.   }
  69. \DeclareOption{brazilian}{%
  70.   \def\Headertext{Cabe\c{c}alho}
  71.   \def\Bodytext{Corpo}
  72.   \def\Footertext{Rodap\'e}
  73.   \def\MarginNotestext{Notas\\ Marginais}
  74.   \def\oneinchtext{uma polegada}
  75.   \def\notshown{n\~ao mostradas}
  76.   }
  77. \DeclareOption{verbose}{\let\type\typeout}
  78. \DeclareOption{silent}{\let\type\@gobble}
  79. \def\lay@value{}
  80. \DeclareOption{integers}{%
  81.   \renewcommand*{\lay@value}[2]{%
  82.     \expandafter\number\csname #1@#2\endcsname pt}}
  83. \DeclareOption{reals}{%
  84.   \renewcommand*{\lay@value}[2]{\the\csname #2\endcsname}}
  85. \ExecuteOptions{english,silent,integers}
  86. \ProcessOptions
  87. \@ifundefined{bs}{\newcommand\bs{\char '134 }}%
  88.   {\renewcommand\bs{\char '134 }}
  89. \def\ConvertToCount#1#2{%
  90.   #1=#2
  91.   \divide #1 by 65536}
  92. \def\SetToHalf#1#2{#1=#2\relax\divide#1by\tw@}
  93. \def\SetToQuart#1#2{#1=#2\relax\divide#1by4}
  94. \def\Identify#1{%
  95.   \put(\PositionX,\PositionY){\circle{20}}
  96.   \put(\PositionX,\PositionY){\makebox(0,0){\tiny #1}}
  97. }
  98. \def\InsideHArrow#1{{%
  99.   \ArrowLength = #1
  100.   \divide\ArrowLength by \tw@
  101.   \advance\ArrowLength by -10
  102.   \advance\PositionX by -10
  103.   \ifnum\ArrowLength<\z@
  104.     \put(\PositionX,\PositionY){\vector(1,0){-\ArrowLength}}
  105.     \advance\PositionX by 20
  106.     \put(\PositionX,\PositionY){\vector(-1,0){-\ArrowLength}}
  107.   \else
  108.     \put(\PositionX,\PositionY){\vector(-1,0){\ArrowLength}}
  109.     \advance\PositionX by 20
  110.     \put(\PositionX,\PositionY){\vector(+1,0){\ArrowLength}}
  111.   \fi
  112. }}
  113. \def\InsideVArrow#1{{%
  114.   \ArrowLength = #1
  115.   \divide\ArrowLength by \tw@
  116.   \advance\ArrowLength by -10
  117.   \advance\PositionY by -10
  118.   \put(\PositionX,\PositionY){\vector(0,-1){\ArrowLength}}
  119.   \advance\PositionY by 20
  120.   \put(\PositionX,\PositionY){\vector(0,+1){\ArrowLength}}
  121. }}
  122. \def\OutsideHArrow#1#2#3{{%
  123.   \PositionX = #1
  124.   \advance\PositionX by #3
  125.   \put(\PositionX,\PositionY){\vector(-1,0){#3}}
  126.   \PositionX = #1 \advance\PositionX-#2
  127.   \advance\PositionX by -#3
  128.   \put(\PositionX,\PositionY){\vector(+1,0){#3}}
  129. }}
  130. \def\OutsideVArrow#1#2#3#4{{%
  131.   \PositionY = #1
  132.   \advance\PositionY by -#3
  133.   \put(\PositionX,\PositionY){\vector(0,+1){#3}}
  134.   \PositionY = #1
  135.   \advance\PositionY#2
  136.   \advance\PositionY#4
  137.   \put(\PositionX,\PositionY){\vector(0,-1){#4}}
  138. }}
  139. \def\Show#1#2{\bs #2 = \lay@value{#1}{#2}}
  140. \def\Type#1#2{%
  141.   \type{#2 = \lay@value{#1}{#2}}}
  142. \newcount\oneinch
  143. \oneinch=72
  144. \newcount\cnt@paperwidth
  145. \newcount\cnt@paperheight
  146. \ConvertToCount\cnt@paperwidth\paperwidth
  147. \ConvertToCount\cnt@paperheight\paperheight
  148. \newcount\cnt@hoffset
  149. \newcount\cnt@voffset
  150. \ConvertToCount\cnt@hoffset\hoffset
  151. \ConvertToCount\cnt@voffset\voffset
  152. \newcount\cnt@textheight
  153. \newcount\cnt@textwidth
  154. \newcount\cnt@topmargin
  155. \newcount\cnt@oddsidemargin
  156. \newcount\cnt@evensidemargin
  157. \newcount\cnt@headheight
  158. \newcount\cnt@headsep
  159. \newcount\cnt@marginparsep
  160. \newcount\cnt@marginparwidth
  161. \newcount\cnt@marginparpush
  162. \newcount\cnt@footskip
  163. \newcount\fheight
  164. \fheight=12
  165. \newcount\ref@top
  166. \ref@top=\cnt@paperheight \advance\ref@top by -\oneinch
  167. \newcount\ref@hoffset
  168. \newcount\ref@voffset
  169. \ref@hoffset=\cnt@hoffset  \advance\cnt@hoffset by \oneinch
  170. \ref@voffset=\cnt@voffset
  171. \cnt@voffset=\ref@top
  172. \advance\cnt@voffset by -\ref@voffset
  173. \newcount\ref@head
  174. \newcount\ref@body
  175. \newcount\ref@foot
  176. \newcount\ref@margin
  177. \newcount\ref@marginwidth
  178. \newcount\ref@marginpar
  179. \newcount\Interval
  180. \newcount\ExtraYPos
  181. \newcount\PositionX
  182. \newcount\PositionY
  183. \newcount\ArrowLength
  184. \def\lay@getvalues{%
  185.   \ConvertToCount\cnt@textheight\textheight
  186.   \ConvertToCount\cnt@textwidth\textwidth
  187.   \ConvertToCount\cnt@topmargin\topmargin
  188.   \ConvertToCount\cnt@oddsidemargin\oddsidemargin
  189.   \ConvertToCount\cnt@evensidemargin\evensidemargin
  190.   \ConvertToCount\cnt@headheight\headheight
  191.   \ConvertToCount\cnt@headsep\headsep
  192.   \ConvertToCount\cnt@marginparsep\marginparsep
  193.   \ConvertToCount\cnt@marginparwidth\marginparwidth
  194.   \ConvertToCount\cnt@marginparpush\marginparpush
  195.   \ConvertToCount\cnt@footskip\footskip
  196.   \ref@head=\ref@top
  197.     \advance\ref@head by -\ref@voffset
  198.     \advance\ref@head by -\cnt@topmargin
  199.     \advance\ref@head by -\cnt@headheight
  200.   \ref@body=\ref@head
  201.     \advance\ref@body by -\cnt@headsep
  202.     \advance\ref@body by -\cnt@textheight
  203.   \ref@foot=\ref@body
  204.     \advance\ref@foot by -\cnt@footskip
  205.   }
  206. \AtBeginDocument{\lay@getvalues}
  207. \newcommand\layout{%
  208.   \@ifstar{\lay@getvalues\lay@xlayout}{\lay@xlayout}}
  209. \def\lay@xlayout{%
  210.   \lay@layout
  211.   \if@twoside
  212.     \lay@layout
  213.   \fi}
  214. \newcommand\lay@layout{%
  215.   \thispagestyle{empty}
  216.   \if@twoside
  217.     \ifodd\count\z@
  218.       \typeout{Two-sided document style, odd page.}
  219.       \ref@marginwidth=\cnt@oddsidemargin
  220.       \ref@marginpar=\oneinch
  221.       \advance\ref@marginpar by \ref@hoffset
  222.       \advance\ref@marginpar by \cnt@oddsidemargin
  223.       \ref@margin\ref@marginpar
  224.       \if@reversemargin
  225.         \advance\ref@marginpar by -\cnt@marginparsep
  226.         \advance\ref@marginpar by -\cnt@marginparwidth
  227.       \else
  228.         \advance\ref@marginpar by \cnt@textwidth
  229.         \advance\ref@marginpar by \cnt@marginparsep
  230.       \fi
  231.     \else
  232.   \typeout{Two-sided document style, even page.}
  233.       \ref@marginwidth=\cnt@evensidemargin
  234.       \ref@marginpar=\oneinch
  235.       \advance\ref@marginpar by \ref@hoffset
  236.       \advance\ref@marginpar by \cnt@evensidemargin
  237.       \ref@margin\ref@marginpar
  238.       \if@reversemargin
  239.         \advance\ref@marginpar by \cnt@textwidth
  240.         \advance\ref@marginpar by \cnt@marginparsep
  241.       \else
  242.         \advance\ref@marginpar by -\cnt@marginparsep
  243.         \advance\ref@marginpar by -\cnt@marginparwidth
  244.       \fi
  245.     \fi
  246.   \else
  247.     \typeout{One-sided document style.}
  248.     \ref@marginwidth=\cnt@oddsidemargin
  249.     \ref@marginpar=\oneinch
  250.     \advance\ref@marginpar by \ref@hoffset
  251.     \advance\ref@marginpar by \cnt@oddsidemargin
  252.     \ref@margin\ref@marginpar
  253.     \if@reversemargin
  254.       \advance\ref@marginpar by -\cnt@marginparsep
  255.       \advance\ref@marginpar by -\cnt@marginparwidth
  256.     \else
  257.       \advance\ref@marginpar by \cnt@textwidth
  258.       \advance\ref@marginpar by \cnt@marginparsep
  259.     \fi
  260.   \fi
  261.   \setlength{\unitlength}{.5pt}
  262.   \begin{picture}(\cnt@paperwidth,\cnt@paperheight)
  263.     \centering
  264.     \thicklines
  265.     \put(0,0){\framebox(\cnt@paperwidth,\cnt@paperheight){\mbox{}}}
  266.     \put(0,\cnt@voffset){\dashbox{10}(\cnt@paperwidth,0){\mbox{}}}
  267.     \put(\cnt@hoffset,0){\dashbox{10}(0,\cnt@paperheight){\mbox{}}}
  268.     \put(\ref@margin,\ref@head){%
  269.       \framebox(\cnt@textwidth,\cnt@headheight)%
  270.         {\footnotesize\Headertext}}
  271.     \put(\ref@margin,\ref@body){%
  272.       \framebox(\cnt@textwidth,\cnt@textheight){\Bodytext}}
  273.     \put(\ref@margin,\ref@foot){%
  274.       \framebox(\cnt@textwidth,\fheight){\footnotesize\Footertext}}
  275.     \put(\ref@marginpar,\ref@body){%
  276.       \framebox(\cnt@marginparwidth,\cnt@textheight)%
  277.                {\footnotesize\shortstack{\MarginNotestext}}}
  278.     \thinlines
  279.     \SetToHalf\PositionX\cnt@textwidth
  280.     \advance\PositionX by \ref@margin
  281.     \PositionY = \ref@body
  282.     \advance\PositionY by 50
  283.     \Identify{8}
  284.     \InsideHArrow\cnt@textwidth
  285.     \SetToHalf\PositionY\cnt@textheight
  286.     \advance\PositionY by \ref@body
  287.     \PositionX = \cnt@textwidth
  288.     \divide\PositionX by 5
  289.     \multiply \PositionX by 4
  290.     \advance\PositionX by \ref@margin
  291.     \Identify{7}
  292.     \InsideVArrow\cnt@textheight
  293.     \PositionY = \ref@foot
  294.     \SetToHalf\PositionX\cnt@hoffset
  295.     \Identify{1}
  296.     \InsideHArrow\cnt@hoffset
  297.     \SetToQuart\PositionY\cnt@textheight
  298.     \advance\PositionY by \ref@body
  299.     \OutsideHArrow\ref@margin\ref@marginwidth{20}
  300.     \PositionX = \cnt@hoffset
  301.     \advance\PositionX by -30
  302.     \Identify{3}
  303.     \SetToQuart\PositionY\cnt@textheight
  304.     \advance\PositionY by \ref@body
  305.     \advance\PositionY by 30
  306.     \SetToHalf\PositionX\cnt@marginparwidth
  307.     \advance\PositionX by \ref@marginpar
  308.     \Identify{10}
  309.     \InsideHArrow\cnt@marginparwidth
  310.     \advance\PositionY by 30
  311.     \if@twoside
  312.       \ifodd\count\z@
  313.         \OutsideHArrow\ref@marginpar\cnt@marginparsep{20}
  314.         \PositionX = \ref@marginpar
  315.       \else
  316.         \OutsideHArrow\ref@margin\cnt@marginparsep{20}
  317.         \PositionX = \ref@margin
  318.       \fi
  319.     \else
  320.       \OutsideHArrow\ref@marginpar\cnt@marginparsep{20}
  321.       \PositionX = \ref@marginpar
  322.     \fi
  323.     \advance\PositionX by 30
  324.     \Identify{9}
  325.     \PositionX = \cnt@textwidth
  326.     \divide\PositionX by 8
  327.     \advance\PositionX by \ref@margin
  328.     \OutsideVArrow\ref@foot\cnt@footskip{20}{20}
  329.     \PositionY = \ref@foot
  330.     \advance\PositionY by -30
  331.     \Identify{11}
  332.     \PositionX = \cnt@paperwidth
  333.     \advance\PositionX by -50
  334.     \PositionY = \cnt@paperheight
  335.     \ExtraYPos = \PositionY
  336.     \advance\ExtraYPos by -\cnt@voffset
  337.     \advance\PositionY by \cnt@voffset
  338.     \divide\PositionY by \tw@
  339.     \Identify{2}
  340.     \InsideVArrow\ExtraYPos
  341.     \Interval = \cnt@textwidth
  342.     \divide\Interval by 8
  343.     \PositionX = \ref@margin
  344.     \advance\PositionX by \Interval
  345.     \Identify{4}
  346.     \ExtraYPos = \ref@head
  347.     \advance\ExtraYPos\cnt@headheight
  348.     \ArrowLength = \PositionY
  349.     \advance\ArrowLength-\ExtraYPos
  350.     \advance\ArrowLength-\cnt@topmargin
  351.     \advance\ArrowLength-10%
  352.     \OutsideVArrow\ExtraYPos\cnt@topmargin{20}{\ArrowLength}
  353.     \advance\PositionX by \Interval
  354.     \Identify{5}
  355.     \advance\ArrowLength\cnt@topmargin
  356.     \OutsideVArrow\ref@head\cnt@headheight{20}{\ArrowLength}
  357.     \advance\PositionX by \Interval
  358.     \Identify{6}
  359.     \advance\ArrowLength\cnt@headheight
  360.     \ExtraYPos=\ref@body
  361.     \advance\ExtraYPos\cnt@textheight
  362.     \OutsideVArrow\ExtraYPos\cnt@headsep{20}{\ArrowLength}
  363.   \end{picture}
  364.  
  365.   \medskip
  366.   \vtop to 0pt{%
  367.     \@minipagerestore\footnotesize\ttfamily
  368.     \begin{tabular}{@{}rl@{\hspace{20pt}}rl}
  369.       1 & \oneinchtext\ + \bs\texttt{hoffset}
  370.         & 2 & \oneinchtext\ + \bs\texttt{voffset} \\
  371.       3 & \if@twoside
  372.             \ifodd\count\z@ \Show{cnt}{oddsidemargin}
  373.             \else \Show{cnt}{evensidemargin}
  374.             \fi
  375.           \else
  376.             \Show{cnt}{oddsidemargin}
  377.           \fi                    & 4 & \Show{cnt}{topmargin} \\
  378.       5 & \Show{cnt}{headheight} & 6 & \Show{cnt}{headsep} \\
  379.       7 & \Show{cnt}{textheight} & 8 & \Show{cnt}{textwidth} \\
  380.       9 & \Show{cnt}{marginparsep}&10& \Show{cnt}{marginparwidth} \\
  381.       11& \Show{cnt}{footskip}   &   & \Show{cnt}{marginparpush}
  382.        \rlap{(\notshown)}\\
  383.         & \Show{ref}{hoffset}    &   & \Show{ref}{voffset} \\
  384.         & \Show{cnt}{paperwidth} &   & \Show{cnt}{paperheight} \\
  385.  
  386.   \end{tabular}\vss}
  387.   \Type{ref}{hoffset}
  388.   \Type{ref}{voffset}
  389.   \Type{cnt}{textheight}
  390.   \Type{cnt}{textwidth}
  391.   \newpage
  392. }
  393. \endinput
  394. %%
  395. %% End of file `layout.sty'.
  396.